<?php
if (isset($_POST['news_button'])) {
    require_once 'dbconnect.php';
    $news = $_POST['news'];
    mysql_query("INSERT INTO news (new) VALUES ('$news')") or die(mysql_error());
    header('location: index.php');
} else {
?>
    <form method="post" action="index.php?show=news" id="news_form">
        <textarea name="news"></textarea><br>
        <input type="submit" name="news_button" value="Kiír">
    </form>
<?php
}
?>
